<?php
$this->breadcrumbs=array(
	'Reports'=>array('/reports'),
	'Logistics',
);?>

<!--
<h1><?php echo $this->id . '/' . $this->action->id; ?></h1>

<p>
	You may change the content of this page by modifying
	the file <tt><?php echo __FILE__; ?></tt>.
</p>
-->

</style>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl;?>/assets/4d2e049c/gridview/styles.css" />

<div class="grid-view">
<table>
<tr>
  <td width="1">
    <table class="items" style="width:300px;">
    <tr>
      <th> Area </th> <th> Members </th> 
    </tr>
    <?php foreach( $reports as $region => $report ) { ?>
       <tr class="odd">
         <td> <strong>
                <a href="<?php echo Yii::app()->request->baseUrl;?>?r=Reports/logistics&region_id=<?php echo $report['region_id']?>">
		         <?php echo $region?>
               </a>  
                 </strong> 
              </td>
         <td> <strong><?php echo $report['total_members']?></strong></td>
       </tr>
       
       <?php foreach( $report['provinces'] as $item ) { ?>
          <tr class="even">
            <td style="text-indent: 20px;"> 
               <a href="<?php echo Yii::app()->request->baseUrl;?>?r=Reports/logistics&province_id=<?php echo $item['province_id']?>">
			    <?php echo $item['province']?> 
               </a>
            </td>
            <td> <?php echo $item['total_members']?></td>
          </tr>
       <?php } ?>
       
    <?php } ?>
    </table>
    <div> <a target="_blank" href="<?php echo $excel_logistics?>"> Download Excel </a> </div>
  </td>
  <td style="vertical-align:top;">
     <?php if ( !count($members) ) { ?>
       <h3> Click Area to View Members </h3>
     <?php } else { ?>
         <table class="items">
         <tr> 
             <th> Region</th> <th> Province </th> <th> ID </th> <th> First Name </th> <th> Last Name </th> 
         </tr>
           <?php foreach( $members as $member ) { ?>
              <tr class="even">
                <td> <?php echo $member['region']?> </td>
                <td> <?php echo $member['province']?> </td>
                <td> <?php echo $member['member_id']?></td>
                <td> <?php echo $member['first_name']?> </td>
                <td> <?php echo $member['last_name']?></td>
              </tr>
           <?php } ?>
         </table>
         
         <div> <a target="_blank" href="<?php echo $excel_link?>"> Download Excel </a> </div>
     <?php } ?>
  </td>
</tr>
</table>
</div>




